package fancyfoods.rest;

import static org.ops4j.peaberry.util.TypeLiterals.export;

import java.util.List;

import org.ops4j.peaberry.Peaberry;

import com.google.inject.AbstractModule;

import fancyfoods.food.Food;
import fancyfoods.food.Inventory;

public class Config extends AbstractModule {
	@Override
	protected void configure() {

		bind(export(Inventory.class)).toProvider(
				Peaberry.service(InventoryImpl.class).export());
		/* Import */
		/*
		 * bind(Service.class).toProvider(service(Service.class).single());
		 * 
		 * Import Multiple bind(iterable(Service.class)).toProvider(
		 * service(Service.class).multiple());
		 * 
		 * Export bind(export(ServiceImpl.class)).toProvider(
		 * service(ServiceImpl.class).export());
		 * 
		 * Configure
		 * bind(Integer.class).annotatedWith(named("test")).toProvider(
		 * configurable(Integer.class).from("test.pid").named("test.key"));
		 */
	}

	private static class InventoryImpl implements Inventory {

		public Food getFood(String name) {
			return new Food() {

				public String getName() {
					return "Peaberry Food";
				}

				public double getPrice() {
					// TODO Auto-generated method stub
					return 10;
				}

				public int getQuantityInStock() {
					// TODO Auto-generated method stub
					return 10;
				}

			};
		}

		public List<Food> getFoodsWhoseNameContains(String name, int maxResults) {
			// TODO Auto-generated method stub
			return null;
		}

		public void createFood(String name, double price, int quantity) {
			// TODO Auto-generated method stub

		}

		public int removeStock(String name, int quantity) {
			// TODO Auto-generated method stub
			return 0;
		}

		public int getFoodCount() {
			// TODO Auto-generated method stub
			return 0;
		}

	}

}
